package com.it.homrwork;

import java.io.*;
import java.net.Socket;

/**
 * @author げっしょく
 * @date 2021/8/10
 */
public class Test1 {
    public static void main(String[] args) throws IOException {
        Socket s = new Socket("127.0.0.1", 14438);
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
        BufferedReader br = new BufferedReader(new FileReader("Info.txt"));
        String line;
        while ((line = br.readLine()) != null) {
            bw.write(line);
        }
        bw.flush();
        s.shutdownOutput();
        InputStream is = s.getInputStream();
        br = new BufferedReader(new InputStreamReader(is));
        while ((line = br.readLine()) != null) {
            System.out.println(line);
        }
        br.close();
        s.close();

    }
}
